package com.woniuxy.userapp.client;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.woniuxy.commons.util.Result;
import com.woniuxy.userapp.client.param.AddVenueInfo;
import com.woniuxy.userapp.client.param.VenueInfo;
import com.woniuxy.userapp.client.param.VenueOpenOrCloseInfo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.io.UnsupportedEncodingException;

@FeignClient(contextId = "VenueClient",name="yoga-user", path="/user")
@Component
public interface VenueClient {

    /**
     * 修改场馆的状态:开业歇业
     */
    @ApiOperation("修改场馆的状态:开业歇业")
    @RequestMapping(value = "/venue/venueOpenOrClose",method = RequestMethod.POST)
    public Result venueOpenOrClose(@RequestBody VenueOpenOrCloseInfo venueOpenOrCloseInfo);

    /**
     * 根据前台账户id查询Alipay账户
     */
    @ApiOperation("根据前台账户id查询Alipay账户")
    @RequestMapping(value = "/venue/loadAlipayById",method = RequestMethod.GET)
    public Result<VenueInfo> loadAlipayById(@RequestParam Integer account_id);

    @ApiOperation("通过场馆id查询该场馆的账户id")
    @GetMapping(value = "/venue/findAccountIdByVenueId")
    public Result<Integer> findAccountIdByVenueId(@RequestParam Integer VenueId);

    @ApiOperation("根据前台账户id场馆信息")
    @RequestMapping(value = "/venue/findVenueByAccountId",method = RequestMethod.GET)
    public Result<VenueInfo> findVenueByAccountId(@RequestParam Integer account_id);

    @ApiOperation("根据场馆id查询场馆信息")
    @RequestMapping(value = "/venue/findVenueByVenueId",method = RequestMethod.GET)
    public Result<VenueInfo> findVenueByVenueId(@RequestParam Integer venueId);

    @ApiOperation("完善场馆信息")
    @RequestMapping(value = "/venue/addVenue",method = RequestMethod.POST)
    public Result addVenue(@Valid @RequestBody AddVenueInfo addvenueInfo);
}
